#include <compact.h>
#include <stdio.h>
int main() {
    heap_pointer<int> pointers[10]; 
    int size;
    for (int i = 0; i < 10; ++i) {
        pointers[i] = allocate<int>(100);
        pointers[i] = i;
    }
//    for (int i = 0; i < 10; i += 2) {
  //      pointers[i].free();
    //}
	printf("!!!!!!!!!!!!!!!!!!!!!!\n");
	void ** ptr = pointer_to_heap();
	printf("%p ", *ptr);
	printf("!!!!!!!!!!!!!!!!!!!!!!\n");
	fflush(stdout);
	void ** nextptr = getnext_ptr_in_heap(ptr);
	printf("%p\n ", *nextptr);
	nextptr = getnext_ptr_in_heap(nextptr);
	printf("%p ", *nextptr);
	nextptr = getnext_ptr_in_heap(nextptr);
	printf("%p ", *nextptr);
//	nextptr = getnext_ptr_in_heap(&nextptr);
//	printf("%p ", nextptr);
//	nextptr = getnext_ptr_in_heap(&nextptr);
//	printf("%p ", nextptr);

 	printf("!!!!!!!!!!!!!!!!!!!\n");

    print_heap_dump();
    struct myinfo info = myinfo();
    for (int i = 1; i < 10; i+= 2) {
        printf("%d ", *(pointers[i]));
    }
    printf("\n");
    allocate<int>(200);
    print_heap_dump();
    info = myinfo();
    for (int i = 1; i < 10; i+= 2) {
        printf("%d ", *(pointers[i]));
    }
    printf("\n");
}
